﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bluyel.Core
{
    /// <summary>
    /// Select mode set in data named LOV.
    /// define how many values can be selected: single, many.
    /// </summary>
    public enum DEnumSelectMode
    {
        // can select a single value, the default case
        Single,

        // can select many values
        Many,
    }

    /// <summary>
    /// represents a data named instance LOV (List Of Values).
    /// </summary>
    public interface IDEnum : IDataNamed
    {
        ITypeEnum TypeEnum { get; }

        //void SetMode(TypeLOVSelectMode mode);

        /// <summary>
        /// The select mode of type.
        /// </summary>
        TypeEnumSelectMode TypeSelectMode { get; }

        /// <summary>
        /// The select mode of the data.
        /// </summary>
        DEnumSelectMode SelectMode { get; }
    
        int ClearSelection();

        /// <summary>
        /// Return the selected value, can be null.
        /// If selection mode is many, return the first one.
        /// </summary>
        IValue SelectedVal { get; }

        /// <summary>
        /// Return the list of selected values, use it if selection mode is many.
        /// </summary>
        IEnumerable<IValue> ListSelectedVal { get; }

        // select this value
        bool SelectVal(IValue dvValue);

        // select a value by pos
        IValue SelectValAt(int pos);
    }
}
